package revontuli.aMHD.dataclasses;

import java.util.ArrayList;

public class Line implements Comparable<Line>{
	public class LineStop {
		public int order;
		public int id;
		public int platform;
		public int distance_time;
		
		public LineStop(int order) {
			this.order = order;
		}
	}
	
	public int id;
	public int direction; //0 alebo 1
	public String name;
	public int vehicle;
	public boolean active;
	public String exceptional_ind;
	public String exceptional_desc;
	public int line_revision;
	public boolean update;
	public ArrayList<LineStop> stops;
	
	public Line(int id) {
		this.id = id;
	}

	@Override
	public int compareTo(Line another) {
		Integer n1;
		Integer n2;
		try {
			n1 = Integer.parseInt(this.name);
			n2 = Integer.parseInt(another.name);
		} catch (NumberFormatException e) {
			return this.name.compareTo(another.name);
		}
		return n1 - n2;
	}
}
